<?php
/**
 * Created by PhpStorm.
 * User: RenBin
 * Date: 2015/9/10
 * Time: 10:18
 */

namespace common\models\Service;


use common\models\DAO\RegionPhone;

class RegionService {

    public static function get($tel){
        $start = intval(substr($tel, 0, 7));
        $info = RegionPhone::findOne(['phone'=>$start]);
        if($info)
            return ['p'=>$info['province'], 'c'=>$info['city']];
        else
            return ['p'=>'未知', 'c'=>'未知'];
    }
}